package com.group.eams.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.group.eams.pojo.dto.AssetReturnQueryDto;
import com.group.eams.pojo.dto.FixedAssetDetailQueryDto;
import com.group.eams.pojo.entity.AssetReturn;
import com.group.eams.pojo.vo.AssetReturnListVo;
import com.group.eams.pojo.vo.FixedAssetDetailListVo;
import com.group.eams.service.AssetReturnService;
import com.group.eams.mapper.AssetReturnMapper;
import org.springframework.stereotype.Service;

/**
* @author 恩哲欣
* @description 针对表【asset_return(资产归还表)】的数据库操作Service实现
* @createDate 2024-10-29 16:09:34
*/
@Service
public class AssetReturnServiceImpl extends ServiceImpl<AssetReturnMapper, AssetReturn>
implements AssetReturnService{

    @Override
    public Page<AssetReturnListVo> findAssetReturnList(AssetReturnQueryDto assetReturnQueryDto) {
        Page<AssetReturnListVo> page = new Page<>(assetReturnQueryDto.getPage(),assetReturnQueryDto.getLimit());
        return getBaseMapper().assetReturnList(page,assetReturnQueryDto);
    }

    @Override
    public AssetReturn findByApplicationNum(String applicationNum) {
        return getBaseMapper().findByApplicationNum(applicationNum);
    }

    @Override
    public Page<FixedAssetDetailListVo> findByQueryDto(FixedAssetDetailQueryDto fixedAssetDetailQueryDto) {
        Page<FixedAssetDetailListVo> page = new Page<>(fixedAssetDetailQueryDto.getPage(), fixedAssetDetailQueryDto.getLimit());
        return getBaseMapper().findByQueryDto(page,fixedAssetDetailQueryDto);
    }

    @Override
    public int deleteByApplicationNum(String applicationNum) {
        return getBaseMapper().deleteByApplicationNum(applicationNum);
    }
}
